import 'package:fish_redux/fish_redux.dart';
import 'package:www.znpigai.teacher/home_page/practice_list_component/component.dart';
import 'package:www.znpigai.teacher/home_page/student_mine_component/component.dart';
import 'package:www.znpigai.teacher/home_page/subject_tab_component/component.dart';

import '../home_page/camera_component/component.dart';
import '../home_page/mine_component/component.dart';
import 'answer_list_component/component.dart';
import 'effect.dart';
import 'homework_list_component/component.dart';
import 'reducer.dart';
import 'state.dart';
import 'view.dart';

class HomePage extends Page<HomeState, Map<String, dynamic>> {
  HomePage()
      : super(
          initState: initState,
          effect: buildEffect(),
          reducer: buildReducer(),
          view: buildView,
          dependencies: Dependencies<HomeState>(
              adapter: null,
              slots: <String, Dependent<HomeState>>{
                'homework': HomeworkConnector() + HomeworkListComponent(),
                'practice': PracticeConnector() + PracticeListComponent(),
                'subject': SubjectConnector() + SubjectTabComponent(),
                'mine': MineConnector() + MineComponent(),
                'camera': CameraConnector() + CameraComponent(),
                'answer': AnswerConnector() + AnswerListComponent(),
                'student_mine': StudentMineConnector() + StudentMineComponent(),
              }),
          middleware: <Middleware<HomeState>>[
            logMiddleware(tag: 'HomePage'),
          ],
        );
}
